﻿Public Class ViewUserProfile
    Inherits System.Web.UI.Page

 


    Private Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles FormView1.ItemUpdating
        Dim fileupload1 As FileUpload = CType(Me.FormView1.FindControl("fileupload1"), FileUpload)



        If fileupload1.HasFile = True Then
            '  fileupload1.SaveAs(MapPath(fileupload1.FileName))
            Dim filepath As String = fileupload1.PostedFile.FileName

            fileupload1.PostedFile.SaveAs(Server.MapPath(".\UserPictures\") & filepath)
            Session("fileupload") = "~\UserPictures\" & fileupload1.FileName

        End If
    End Sub

    Protected Sub FormView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles FormView1.PageIndexChanging

    End Sub

    Private Sub ViewUserProfile_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            SqlDataSource1.Update()
        End If

    End Sub
End Class